
package com.welsy.authoring.model
{
   import mx.collections.ICollectionView;
   import com.adobe.cairngorm.model.ModelLocator;
   import com.welsy.util.Comparator;   
   import com.welsy.authoring.vo.CourseComponentsVO;
   import mx.collections.ArrayCollection;   
   import com.welsy.authoring.vo.course.TestComponents;
   import com.welsy.authoring.vo.course.Answer;
   import com.welsy.authoring.vo.course.Question;
   import com.welsy.authoring.vo.course.ResultVO;
   import com.welsy.authoring.vo.TestResultVO; 
   
   [Bindable]
   public class CourseModelLocator implements ModelLocator
   {
      private static var modelLocator : CourseModelLocator;
      
      public static function getInstance() : CourseModelLocator 
      {
      	if ( modelLocator == null )
      	{
      		modelLocator = new CourseModelLocator();
      	}
      		
      	return modelLocator;
      }
      
      //Constructor should be private but current AS3.0 does not allow it yet (?)...
      public function CourseModelLocator() 
      {	
         if ( modelLocator != null )
         {
         	throw new Error( "Only one CourseModelLocator instance should be instantiated" );	
         }
         
         //assets = new CairngormCourseAssets();
      }
               
      public var courses : ICollectionView;    
      public var coursesPublish : ICollectionView;     
      public var selectedCourse : CourseComponentsVO;
      public var selectedTest : TestComponents;
      public var selectedQuestion : Question;     
      public var selectedAnswer : Answer;
      public var resultVO : ResultVO;
      public var testResultVO : TestResultVO;  
      public var uploadedAudioID : Number = 0; 
      public var uploadedFileID : Number = 0;
      public var uploadedFileIDTest : Number = 0;      
      public var uploadedFileName : String;
      public var workflowState : Number = VIEWING_COURSES;
      public var startTimeQuestion : Date;
	  public var endTimeQuestion : Date;
	  public var courseEditing: Boolean;
			
      public var questionAnswers : ArrayCollection = new ArrayCollection; //the list of all the responses in the test result
              
      public static var VIEWING_COURSES : Number = 0;
      public static var VIEWING_SELECTED_COURSE : Number = 1;
      public static var VIEWING_SELECTED_TEST : Number = 2;        
   }

}
